#!/bin/sh
echo "begin install my17ce"
if [ $# == 1 ]; then
	echo "my17CE user name -->$1"
	echo "if the user name is error ,ctrl +c exit"
	sleep 3
else 
	echo "please use the cmd-->"
	echo " ./my17ce_init.sh 104692671@qq.com"
	exit 1
fi
echo 
rm -rf /etc/storage/my17ce
rm -rf /tmp/my17ce
rm -rf my17ce*
cd /tmp
wget -O my17ce.t https://gitee.com/asanfa/my17ce/blob/master/etc/my17ce_run.sh
sed "s/USER_NAME/$1/g" my17ce.t > my17ce_run.sh
mkdir /etc/storage/my17ce
cp my17ce_run.sh /etc/storage/my17ce/my17ce_run.sh
chmod +x /etc/storage/my17ce/my17ce_run.sh
if grep -wq "my17ce_run.sh" /etc/storage/post_wan_script.sh; then
  /etc/storage/my17ce/my17ce_run.sh $1
else
  echo "/etc/storage/my17ce/my17ce_run.sh">>/etc/storage/post_wan_script.sh
  /etc/storage/my17ce/my17ce_run.sh $1
fi